import { Component } from 'react';
import { Card, Row, Col } from 'antd';

class CompanysInfo extends Component {

  render() {
    const {
      headStyle,
      renderField,
      changedInformation,
      changedImg,
    } = this.props;

    return (
        <Card
            title="公司信息"
            headStyle={headStyle}
            style={{ marginBottom: '20px' }}
          >
            <Row>
              <Col span={12}>
                <div style={{ marginBottom: '10px' }}>公司名称：{renderField('name')}</div>
                <div style={{ marginBottom: '10px' }}>
                  统一社会信用代码：{renderField('creditCode')}
                </div>
                <div style={{ marginBottom: '10px' }}>
                  公司注册地址：{renderField('provinceName')} {renderField('cityName')} {renderField('countyName')} {renderField('companyPlaceRegister')}
                </div>
                <div style={{ marginBottom: '10px' }}>经营地址：{renderField('locationProvinceName')} {renderField('locationCityName')} {renderField('locationCountyName')} {renderField('companyPlace')}</div>
                <div style={{ marginBottom: '10px' }}>
                  营业期限：{renderField('dueStartDate')} ~ {renderField('dueEndDate')}
                </div>
                {/* <div style={{ marginBottom: '10px' }}>
                  公司类型：
                  {changedInformation.companyType ? (
                    <span style={{ color: 'red' }}>{companys[changedInformation.companyType]}</span>
                  ) : (
                    companys[information.companyType]
                  )}
                </div> */}
                <div style={{ marginBottom: '10px' }}>营业范围：{renderField('businessScope')}</div>
                <div>
                  公司logo：
                  {renderField('companyLogoInfo', val => val) && (
                    <img
                      style={{
                        ...{ maxWidth: '100%' },
                        ...('companyLogoInfo' in changedInformation ? changedImg : null),
                      }}
                      src={renderField('companyLogoInfo', val => val).url}
                      alt="公司logo"
                    />
                  )}
                </div>
              </Col>
              <Col span={12}>
                <div style={{ marginBottom: '10px' }}>营业执照证件：</div>
                {renderField('businessLicenceIdInfo', val => val) && (
                  <img
                    style={{
                      ...{ maxWidth: '100%' },
                      ...(changedInformation.businessLicenceIdInfo ? changedImg : null),
                    }}
                    src={renderField('businessLicenceIdInfo', val => val).url}
                    alt="营业执照证件"
                  />
                )}
              </Col>
            </Row>
          </Card>
    );
  }
}

export default CompanysInfo;
